package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {


    void saveUserAccount(Long userId);

    /**
     * 获取账户可用余额
     * /api/account/userAccount/getAvailableAmount
     * @return
     */
    BigDecimal getAvailableAmount(Long userId);

    /**
     * 扣减账户余额
     * /api/account/userAccount/checkAndDeduct
     */
    void checkAndDeduct(AccountLockVo accountLockVo);
}
